package com.wfg.expresscompany.Service;

import com.wfg.expresscompany.component.ShippingChannelsFactory;
import com.wfg.expresscompany.entity.Package;
import com.wfg.expresscompany.enums.ShippingChannelsEnum;

import javax.annotation.PostConstruct;

/**
 * @author: 王富贵
 * @description: 发货渠道抽象
 * @createTime: 2023/05/24 22:14
 */
public interface ShippingChannels {

    @PostConstruct
    default void init() {
        ShippingChannelsFactory.registerShippingChannels(getShippingChannels(), this);
    }

    // 运送货物
    void transport(Package pkg);

    // 获取映射枚举
    ShippingChannelsEnum getShippingChannels();
}
